<?php
/**
 * Created by JetBrains PhpStorm.
 * User: zhouyang
 * Date: 13-7-15
 * Time: 下午4:31
 * To change this template use File | Settings | File Templates.
 */
class SourcesModel extends Model{
    //根据source_id 获取 source 信息
    public function get($source_id){
        return $this->dbreader()->get($source_id);
    }

    //获取来源信息列表<带分页>
    public function getSourceList($curr_page,$per_page,$filter = array()){
        return $this->dbreader()->getSourceList($curr_page,$per_page,$filter);
    }

    //获取所有来源信息
    public function getSources($filter = array(),$flag = false){
        return $this->dbreader()->getSources($filter,$flag);
    }

    //添加来源信息
    public function addSource($title, $site_address){
        return $this->dbreader()->addSource($title, $site_address);
    }

    //删除来源信息
    public function delSource($source_id){
        return $this->dbreader()->delSource($source_id);
    }

    //更新来源信息
    public function updateSource($id,$title,$site_address){
        return $this->dbreader()->updateSource($id,$title,$site_address);
    }
}